﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GenericLibrariesToolKit;
using Utils;

namespace Model
{
    /// <summary>
    /// 建议书回复实体
    /// </summary>
    public class RFPReply
    {
        /*RFP回复Id*/
        public string RFPReplyId { get; set; }
        /*RFPID*/
        public string RFPId { get; set; }
        /*RFP回复专家*/
        public string RFPReplyExpert { get; set; }
        /*RFP回复内容*/
        public string RFPReplyContent { get; set; }
        /*RFP回复日期*/
        private string rfpReplyDate = DateTimeUtil.GetDateTime();
        public string RFPReplyDate
        {
            get { return rfpReplyDate; }
            set { rfpReplyDate = value; }
        }

        /// <summary>
        /// 应用程序启动时，实体管理器将会调用此方法进行初始化。
        /// </summary>
        public void Intialization()
        {
            //声明一个实体实体对象
            Entity entity = new Entity();

            //指定该实体对应数据库中的表名
            entity.TableName = "T_RFP_REPLY";
            //指定该实体的标识符
            entity.EntityId = "RFPReplyId";
            //指定主键生成策略
            entity.Generator = GenericLibrariesToolKit.Enumeration.PKGenerationStrategy.GUID;
            ///实体关系映射字典
            ///key:实体属性名称，value:对应的数据库中表的字段名
            Dictionary<string, string> dictionary = new Dictionary<string, string>();

            dictionary.Add("RFPReplyId", "RFP_REPLY_ID");
            dictionary.Add("RFPId", "RFP_ID");
            dictionary.Add("RFPReplyExpert", "RFP_REPLY_EXPERT");
            dictionary.Add("RFPReplyContent", "RFP_REPLY_CONTENT");
            dictionary.Add("RFPReplyDate", "RFP_REPLY_DATE");

            //赋值
            entity.ORMDictionary = dictionary;

            //将实体加入实体管理器，
            EntityManager.GetInsatnce().AddEntity("Model.RFPReply", entity);
        }
    }
}
